﻿@{
    Layout = null;
}

<!DOCTYPE html>
@Html.Partial("LoadPanelPartial")
<html>
<head>
    <title>GSImportDateDelEdit</title>
    @if (false)
 {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
 }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script>

        $(document).ready(function () {
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
                lpModal.Hide();
            }
            if (hdjsAlert == "操作成功") {
                lpModal.Hide();
                parent.codeOK();
            }
        });

        function OK() {
            lpModal.Show();
            var codeNo = FYear.GetText();
            var codeName = FPeriod.GetText();

            if (pd(codeNo, codeName)) {
                form1.submit();
            }
            else {
                lpModal.Hide();
            }
        }

        function pd(codeNo, codeName) {
            var bl = true;
            if (null == codeNo || ASPxClientUtils.Trim(codeNo) == "") {
                FYear.SetErrorText("请填写年度！");
                FYear.SetIsValid(false);
                bl = false;
            }
            if (null == codeName || ASPxClientUtils.Trim(codeName) == "") {
                FPeriod.SetErrorText("请填写编号！");
                FPeriod.SetIsValid(false);
                bl = false;
            }

            return bl;
        }


    </script>
</head>
<body>
    @using (Html.BeginForm("GSImportDateDel", "GSImportDate", FormMethod.Post, new { id = "form1" }))
    {
              <div class="div">
  <table width="99%" align="center">
        <tr>
            <td width="30%" align="right">
               年度:</td>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FYear";
                   settings.Width = 200;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
        <tr>
            <td width="30%" align="right">
                编号:</td>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FPeriod";
                   settings.Width = 200;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>
    </table>
    </div>
             @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));
    <script>
        lp.Hide();
    </script>
    }
</body>
</html>
